package com.anpy.album.service.impl;

import com.anpy.album.entity.AlbumEntity;
import com.anpy.album.mapper.AlbumMapper;
import com.anpy.album.service.AlbumService;
import com.anpy.common.service.BaseServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("albumServiceImpl")
public class AlbumServiceImpl extends BaseServiceImpl<AlbumMapper, AlbumEntity> implements AlbumService {
    @Override
    public boolean saveAlbum(AlbumEntity saveAlbumEntity) {
        return save(saveAlbumEntity);
    }

    @Override
    public List<AlbumEntity> list(Integer id) {
        LambdaQueryWrapper<AlbumEntity> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(AlbumEntity::getUserId,id);
        return list(wrapper);
    }
}
